USE [safe_manage]
GO

/****** Object:  Table [dbo].[shutdown_type]    Script Date: 08/13/2012 22:20:19 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[shutdown_type](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[SHUTDOWN_TYPE] [varchar](100) NOT NULL,
	[DEPARTMENT1_ID] [int] NULL,
 CONSTRAINT [PK_shutdown_type] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

insert into shutdown_type(SHUTDOWN_TYPE, DEPARTMENT1_ID) values('生产', 4)
go
insert into shutdown_type(SHUTDOWN_TYPE, DEPARTMENT1_ID) values('工艺', 5)
go
insert into shutdown_type(SHUTDOWN_TYPE, DEPARTMENT1_ID) values('设备', 6)
go

USE [safe_manage]
GO

/****** Object:  Table [dbo].[shutdown]    Script Date: 08/13/2012 22:20:40 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[shutdown](
	[ID] [int] NOT NULL,
	[SHUTDOWN_TYPE_ID] [int] NOT NULL,
	[LOSS] [varchar](2000) NOT NULL,
	[REASON] [varchar](5000) NOT NULL,
	[DUTY] [varchar](5000) NOT NULL,
	[TEAM] [varchar](500) NOT NULL,
	[PERIOD_START] [datetime] NOT NULL,
	[PERIOD_END] [datetime] NOT NULL,
 CONSTRAINT [PK_shutdown] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


